const { mongoose } = require("./db");
const Schema = mongoose.Schema;


const userSchema = new Schema({
  username: {
    type: String,
    default: "跑腿骑手",
  }, //用户名
  avatarUrl: {
    type: String,
    default: "",
  }, //头像
  real_name: {
    type: String,
    default: "",
  }, //真实姓名
  sex: {
    type: String,
    default: "",
  }, //性别
  isdelete: {
    type: Boolean,
    default: false,
  },
  phone: {
    type: String,
    default: "",
  }, //联系电话
  Idcard: {
    type: String,
    default: "",
  }, //身份证件
  desc: {
    type: String,
  }, //描述
  ID_frontPhoto: {
    type: String,
    default: "",
  }, //身份证正面
  ID_reversePhoto: {
    type: String,
    default: "",
  }, //身份证反面
  address: {
    type: String,
    default: "",
  }, //现居住址
  date_birth: {
    type: Date,
    default: "",
  }, //出生日期
  nation: {
    type: String,
    default: "",
  }, //民族
  marital_status: {
    type: String,
    default: "",
  }, //婚姻状态
  emergency_contact: {
    type: String,
    default: "",
  }, //紧急联系人
  emergency_contact_phone: {
    type: String,
    default: "",
  }, //紧急联系人电话
  permanent_address: {
    type: String,
    default: "",
  }, //户口地
  house_address: {
    type: String,
    default: "",
  }, //家庭住址
  isStop: {
    type: Boolean,
    default: false,
  }, //是否停用
  // 健康信息
  stature: {
    type: String,
    default: "",
  }, //身高
  weight: {
    type: String,
    default: "",
  }, //体重
  blood_type: {
    type: String,
    default: "",
  }, //血型
  RH_negative: {
    type: String,
    default: "",
  }, //RH阴性
  status: {
    //状态
    type: String,
    default: "1",
  },
  nickName: {
    type: String,
    default: "",
  }, //微信名称
  openid: {
    type: String,
    default: "",
  }, //openid
});
const chargeSchema = new Schema({
  basic_delivery :{
    type:Number
  },
  basic_errand:{
    type:Number
  },
  extra:{
    type:Number
  }
});
const rideruserModel = mongoose.model("rideruser", userSchema);
const chargeModel = mongoose.model("charge", chargeSchema);

module.exports = { rideruserModel,chargeModel };
